package main

import (
	"common"
	"demo2/rpc_client"
	"github.com/gin-gonic/gin"
)

func main() {

	engine := gin.Default()
	client := common.InitETCD("demo2", "127.0.0.1", 8082, "1")
	rpc_client.Demo1Method()

	engine.GET("/demo2/test", func(context *gin.Context) {
		context.JSON(200, gin.H{
			"message": "demo2 的Get 的请求",
		})
	})
	engine.POST("/demo2/test", func(context *gin.Context) {
		context.JSON(200, gin.H{
			"message": "demo2 的Post 的请求",
		})
	})
	engine.Run(":8082")
	client.Close()

}
